package com.daoyin.ssph.service.impl;

import java.util.List;

import com.daoyin.ssph.bean.Active;
import com.daoyin.ssph.dao.ActiveDAO;
import com.daoyin.ssph.service.ActivitysService;

public class ActivitysServiceImpl extends BaseServiceImpl<Active> implements ActivitysService{
	private ActiveDAO dao;

	public void setDao(ActiveDAO dao) {
		this.dao = dao;
	}
	@SuppressWarnings("unchecked")
	public List<Active> query(){
		List<Active> list = dao.findAll();
		return list;	
	}
	public String add(Active active){
		dao.save(active);
		return "success";		
	}
	
	public Active query(Integer id){
		Active active = dao.findById(id);
		return active;	
	}
	public void delete(Integer id){
		Active active = dao.findById(id);
		dao.delete(active);
	}
	public String update(Active active){
		dao.merge(active);
		return "success";
		
	}
}
